<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
   
</head>
<!-- v-model 实现双向绑定 -->

<body>
    <div id="app">
        <div>
            <input type="text" @input="valueChange" :value="msg">
            <br>
            <input type="text" @input="msg = $event.target.value" :value="msg">
            <h3>{{msg}}</h3>
        </div>
    </div>
    <script src="js/vue.js"></script>

    <script>
        const HelloVue = {
            data() {
                return {
                   msg:'初始化消息',
                }
            },
            computed: {
            },
            methods: {
                valueChange(event){
                    this.msg = event.target.value;
                }
            }
        };

        const app = Vue.createApp(HelloVue).mount("#app");
    </script>
</body>

</html>